package com.mi.fastbird.common.util.project;

/**
 * 服务端返回的内容
 *
 * @author 王永吉
 * @date 2019/8/20
 */
public enum ResMsg {

    //↑↑↑↑↑↑↑↑ 其他写在上边 ↑↑↑↑↑↑↑↑↑↑
    SUCCESS(200, true, "操作完成"),

    ERROR(500, false, "操作失败"),
    ERROR_400(400, false, "请求参数错误"),
    ERROR_401(401, false, "身份认证失败"),
    ERROR_402(402, false, "权限不足无法访问"),
    ERROR_404(404, false, "请求资源不存在"),
    ERROR_OUT(555, false, "强制退出"),

    RE_SUBMIT(600, false, "重复提交"),

    TIME_OUT(500, false, "连接超时，请检查网络环境");

    public final Integer code;
    public final Boolean success;
    public final String message;

    ResMsg(Integer code, Boolean success, String message) {
        this.code = code;
        this.success = success;
        this.message = message;
    }

    public String toString() {
        return "{" +
                "  \"code\": " + code +
                "  \"success\": ," + success +
                "  \"message\": " + message +
                "}";
    }
}
